package com.sukaiyi.generator.ui.base;

import com.sukaiyi.generator.utils.ProjectUtils;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class InputDialog extends DialogWrapper {
    private JTextField nameTextField;
    private JPanel rootPanel;

    public InputDialog(String initValue) {
        super(ProjectUtils.getProject());
        this.init();
        this.setTitle("Enter New Name");
        nameTextField.setText(initValue);
    }

    public void setValue(String value){
        nameTextField.setText(value);
    }

    public String getValue(){
        return nameTextField.getText();
    }

    @Nullable
    @Override
    protected JComponent createCenterPanel() {
        return rootPanel;
    }
}
